import delimited "build/output/tether_hourly_eastern.csv", delimiter(comma) varnames(1) stripquote(no) clear 


gen double eventtime = clock(eastern_datetime, "YMDhms")
format eventtime %tc

drop eastern_datetime utc_datetime

rename usdt pUSDT

reshape long p, i(date) j(coin) string

drop date
gen date = dofc(eventtime)
format date %td

collapse (max) p_max = p (min) p_min = p, by(coin date)

save "build/output/intraday_stablecoin_prices.dta", replace
